package com.ck.system.mapper;

import com.ck.common.entity.SysRole;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author changk
 * @date 2024/11/12 14:35
 */
@Mapper
public interface SysRoleMapper {
    List<SysRole> selectRolePermissionByUserId(Long userId);

    /**
     * 根据条件分页查询角色数据
     *
     * @param role 角色信息
     * @return 角色数据集合信息
     */
    List<SysRole> selectRoleList(SysRole role);

    SysRole checkRoleNameUnique(String roleName);

    SysRole checkRoleKeyUnique(String roleKey);

    int insertRole(SysRole role);

    int updateRole(SysRole role);

    SysRole selectRoleById(Long roleId);

    int deleteRoleByIds(Long[] roleIds);

    List<SysRole> selectRolesByUserName(String userName);
}
